package com.ctrip.demo.string;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;

public class StringTest {

    private  static final DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
    static String format = "insert into t_mm_resource_book_order (`MATERIAL_NO`,`DT_FROM`,`DT_TO`,`EMPCODE`,`BOOK_STATUS`,`CREATE_USER`,`CREATE_DT`) values ('RM-NT0001.0%s.01','%s 09:00','%s 10:00','TR015103',2,'TR015103',now());";

    public static void main(String[] args) {

        List<String> stringList = new ArrayList<>();
        int index =0 ;
        for (int i = 1; i <= 31; i++) {
            LocalDate now = LocalDate.parse("2022-12-01", dateTimeFormatter);
            LocalDate localDate = now.plusDays(index);
            String format = localDate.format(dateTimeFormatter);
            for (int j = 1; j <= 28; j ++) {
                String str = j + "";
                if (j < 10) {
                    str = "0" + j;
                }
                String sql = String.format(StringTest.format, str, format, format);
                System.out.println(sql);
            }
            index++;
        }
    }

}
